//
//  LJM_HotSongs_CollectionViewCell.m
//  wind
//
//  Created by 李金明 on 16/1/19.
//  Copyright © 2016年 李金明. All rights reserved.
//

#import "LJM_HotSongs_CollectionViewCell.h"
#define HEIGHT 40//TITLE的高度
@implementation LJM_HotSongs_CollectionViewCell
- (void)dealloc
{
    [_label release];
    [_imageV release];
    [_titleLab release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
    }
    return self;
}
- (void)creatView
{
    self.backgroundColor = [UIColor redColor];
    self.imageV = [[UIImageView alloc] init];
    self.imageV.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.imageV];
    [_imageV release];
    self.label = [[UILabel alloc] init];
    self.label.font = [UIFont systemFontOfSize:14];
    self.label.backgroundColor = [UIColor clearColor];
    self.label.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.label];
    [_label release];
    
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.font = [UIFont systemFontOfSize:14];
    self.titleLab.backgroundColor = [UIColor whiteColor];
    self.titleLab.numberOfLines = 0;
    self.titleLab.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.titleLab];
    [_titleLab release];
    
}
- (void)layoutSubviews
{
    [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top);
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
        make.bottom.equalTo(self.mas_bottom).offset(-HEIGHT);
    }];
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.imageV.mas_left);
        make.bottom.equalTo(self.imageV.mas_bottom);
        make.height.mas_equalTo(@20);
        make.width.mas_equalTo(@70);
    }];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mas_bottom);
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
        make.height.mas_equalTo(@HEIGHT);
    }];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
